package com.lagou.service.impl;

import com.lagou.service.ByeService;
import org.apache.dubbo.config.annotation.Service;
import org.orqlog.Utils.IpUtil;

@Service
public class ByeServiceImpl implements ByeService {
    @Override
    public String sayBye(String name) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        String ip = IpUtil.getIp();
        System.out.println("The IP: " + ip);
        return "Bye " + name;
    }

    @Override
    public void methodA() {
        int x=1+(int)(Math.random()*100);
        try {
            Thread.sleep(x);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void methodB() {
        int x=1+(int)(Math.random()*100);
        try {
            Thread.sleep(x);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void methodC() {
        int x=1+(int)(Math.random()*100);
        try {
            Thread.sleep(x);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }


}
